home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Hyper
/
P
/
Portfolio.cpt
/
Home
/
stack.txt
< prev
Wrap
Text File
|
1988-01-24
|
29KB
|
970 lines
-- stack: in
-- format: 8 (HyperCard 1)
-- flags: 0x0 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=0 h=0
-- scroll: x=0 y=0
-- background count: 3
-- first background id: 2282
-- card count: 42
-- first card id: 5341
-- list block id: 4212
-- print block id: 3372
-- font table block id: 0
-- style table block id: 0
-- free block count: 0
-- free size: 0 bytes
-- total size: 100448 bytes
-- stack block size: 26112 bytes
-- created by hypercard version: 0x00000000
-- compacted by hypercard version: 0x00000000
-- modified by hypercard version: 0x00000000
-- opened by hypercard version: 0x00000000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x0000220000002200
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0xCC003300CC003300
-- patterns[4]: 0xCC883322CC883322
-- patterns[5]: 0xEE88BB22EE88BB22
-- patterns[6]: 0xEECCBB33EECCBB33
-- patterns[7]: 0xFFCCFF33FFCCFF33
-- patterns[8]: 0xFFEEFFBBFFEEFFBB
-- patterns[9]: 0xFFFFFFBBFFFFFFBB
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x0
----- HyperTalk script -----
------------------------------------------------------------------------
-- QUITTING 'PORTFOLIO'
------------------------------------------------------------------------
On quit
Put the freesize of this stack into it
If it > 10000 then
Beep
Show message window at 20,302
Put "Wasted Space - "
Put it into word 5 of message window
Put " bytes in 'Portfolio'." into word 7 of message window
Answer "Before quitting; should I compact this stack?" with "No" or "Yes"
End if
If it = "Yes" then
Set cursor to 4
Hide message window
DoMenu Compact Stack
End if
End quit
------------------------------------------------------------------------
-- STARTING 'PORTFOLIO'
------------------------------------------------------------------------
On StartUp
Show MenuBar
Hide message window
GetHomeInfo
Pass StartUp -- to a startUp XCMD, if present
End StartUp
------------------------------------------------------------------------
-- RESUME 'PORTFOLIO'
------------------------------------------------------------------------
On resume
GetHomeInfo
Pass resume -- to a resume XCMD, if present
End resume
------------------------------------------------------------------------
-- GET HOME INFORMATION
------------------------------------------------------------------------
On GetHomeInfo
Global stacks,applications,documents,UserName,action
Set LockScreen to true
Set LockMessages to true
Push this card
Put "Launch" into action
Go to card "User Preferences" of stack "Home"
Put card field "User Name" into UserName
Set UserLevel to card field "User Level"
Set PowerKeys to the hilite of button "Power Keys"
Set BlindTyping to the hilite of button "Blind Typing"
Put field "paths" of card "stacks" into stacks
Put field "paths" of card "applications" into applications
Put field "paths" of card "documents" into documents
Pop card
Set LockScreen to false
Set LockMessages to false
End GetHomeInfo
------------------------------------------------------------------------
-- SEARCH SCRIPT
------------------------------------------------------------------------
On SearchScript pattern,StackName -- search all scripts of a stack
Set LockMessages to true
If StackName is not empty then go to stack StackName
If the script of this stack contains pattern
Then edit script of this stack
Repeat with i = 1 to the number of bkgnds
Go to card 6 of bkgnd i
If the script of this bkgnd contains pattern
Then edit script of bkgnd
Repeat with j = 1 to the number of bkgnd buttons
If the script of bkgnd button j contains pattern
Then edit script of bkgnd button j
End repeat
Repeat with j = 1 to the number of bkgnd fields
If the script of bkgnd field j contains pattern
Then edit script of bkgnd field j
End repeat
End repeat
Repeat with i = 1 to the number of cards
Go card i
If the script of this card contains pattern
Then edit script of this card
Repeat with j = 1 to the number of card buttons
If the script of card button j contains pattern
Then edit script of card button j
End repeat
Repeat with j = 1 to the number of card fields
If the script of card field j contains pattern
Then edit script of card field j
End repeat
End repeat
Set lockMessages to false
End searchScript
------------------------------------------------------------------------
-- LAST PATH NAME
------------------------------------------------------------------------
Function LastPathComponent name
Repeat with i = the length of name down to 1
If character i of name is ":" then exit repeat
End repeat
If i is 1 then
If first character of name is ":" then
Put 2 into i
End if
Else
Add 1 to i
End if
Put empty into LastPath
Repeat with j = i to the length of name
Put character j of name after LastPath
End repeat
Return LastPath
End LastPathComponent
------------------------------------------------------------------------
-- DELETE LAST PART OF LONG NAME
------------------------------------------------------------------------
Function DeleteLastPart LongName
Put the length of LongName into LenghtOfName
Repeat with i = LenghtOfName down to 1
If char i of LongName = ":" then exit repeat
Delete char I of LongName
End Repeat
Return LongName
End DeleteLastPart
------------------------------------------------------------------------
-- BUTTON NAME
------------------------------------------------------------------------
Function ButtonName LongName
Put the length of LongName into LastChar
Repeat with i = LastChar down to 1
If char i of LongName = ":" then exit repeat
End repeat
Return char (i + 1) to LastChar of LongName
End ButtonName
------------------------------------------------------------------------
-- SYSTEM ERRORS
------------------------------------------------------------------------
On OSERR err
If err > 0 then -- XFCN convention
Put "Parameter error with function" into errstr
Else if err is -59 then
Put "Problem during rename" into errstr
Else if err is -54 then
Put "Attempt to open locked file for writing" into errstr
Else if err is -46 then
Put "Volume locked by software" into errstr
Else if err is -45 then
Put "File locked" into errstr
Else if err is -44 then
Put "Volume locked by hardware" into errstr
Else if err is -43 then
Put "File not found" into errstr
Else if err is -37 then
Put "Bad volume or file name" into errstr
Else if err is -36 then
Put "I/O error" into errstr
Else if err is -35 then
Put "No such volume" into errstr
Else if err is -34 then
Put "Disk is full" into errstr
Else if err is -49 then
Put "File already open for writing" into errstr
Else
Put "Failed with error" && err into errstr
End if
Answer Errstr with "OK"
End OSERR
------------------------------------------------------------------------
-- ADD HYPERCARD STACK
------------------------------------------------------------------------
On AddStack
Set LockScreen to true
Show message window at 20,302
Put "Please select the HyperCard 'STACK' that you wish to add to this card."
Put FileName("STAK") into StackName
If StackName = empty then
Put ""
Set LockScreen to false
Choose browse tool
Hide message window
Exit AddStack
End if
Set cursor to 4
Put "One Moment, Please..."
Get short name of StackName
Put it into ShortStackName
DoMenu "New Button"
Set style of button "New Button" to transparent
Set rect of button "New Button" to 220,150,315,198
Set icon of button "New Button" to 1000
Put "On MouseUp -- Stack" & return into ScriptMaker
Put "Global LongName" & return after ScriptMaker
Put "Put " & quote & StackName & quote & " into LongName" & return after ScriptMaker
Put "LaunchStack" & return after ScriptMaker
Put "End MouseUp" & return & return after ScriptMaker
Put "--" & return after ScriptMaker
Put "-- FOR 'PORTFOLIO' TO FUNCTION CORRECTLY; DO NOT MODIFY THIS SCRIPT!" & return after ScriptMaker
Put "--" & return after ScriptMaker
Set script of button "New Button" to ScriptMaker
Set name of button "New Button" to ShortStackName
Choose browse tool
Set LockScreen to false
Show message window at 20,35
Put "Press COMMAND KEY down; CLICK and DRAG icon into position."
Exit AddStack
End AddStack
------------------------------------------------------------------------
-- ADD STAND ALONE APPLICATION
------------------------------------------------------------------------
On AddApplication
Set LockScreen to true
Show message window at 20,302
Put "Please select the 'APPLICATION' that you wish to add to this card."
Put FileName("APPL") into ApplicationName
If ApplicationName is empty then
Put ""
Set LockScreen to false
Choose browse tool
Hide message window
Exit AddApplication
End if
Set cursor to 4
Put "One Moment, Please..."
Put ButtonName(ApplicationName) into ApplicationFile
DoMenu "New Button"
Get the long name of this stack
Put it into StackName
If icon of button "New Button" is not 0 then
Put icon of button "New Button" into DeleteIcon
KillResID StackName,"ICON",DeleteIcon
End if
Put GetAppIcon(ApplicationName,ApplicationFile,StackName) into AddIcon
UpdateResFork
Set icon of button "New Button" to AddIcon
Set style of button "New Button" to transparent
Set rect of button "New Button" to 220,150,315,198
Put "On MouseUp -- Application" & return into ScriptMaker
Put "Global LongName" & return after ScriptMaker
Put "Put " & quote & ApplicationName & quote & " into LongName" & return after ScriptMaker
Put "LaunchApplication" & return after ScriptMaker
Put "End MouseUp" & return & return after ScriptMaker
Put "--" & return after ScriptMaker
Put "-- FOR 'PORTFOLIO' TO FUNCTION CORRECTLY; DO NOT MODIFY THIS SCRIPT!" & return after ScriptMaker
Put "--" & return after ScriptMaker
Set script of button "New Button" to ScriptMaker
Set name of button "New Button" to ApplicationFile
Choose browse tool
Set LockScreen to false
Show message window at 20,35
Put "Press COMMAND KEY down; CLICK and DRAG icon into position."
Exit AddApplication
End AddApplication
------------------------------------------------------------------------
-- ADD DOCUMENT
------------------------------------------------------------------------
On AddDocument
Set LockScreen to true
Show message window at 20,302
Put "First select the 'APPLICATION' that will open the document."
Put FileName("APPL") into ApplicationFile
If ApplicationFile = empty then
Put ""
Set lockScreen to false
Choose browse tool
Hide message window
Exit AddDocument
End if
Put "Now select the 'DOCUMENT' that you wish to add to this card."
Put FileName() into DocumentFile
If DocumentFile = empty then
Put ""
Set LockScreen to false
Choose browse tool
Hide message window
Exit AddDocument
End if
Set cursor to 4
Put "One Moment, Please..."
Put ButtonName(DocumentFile) into DocumentName
DoMenu "New Button"
Get the long name of this stack
Put it into StackName
If icon of button "New Button" is not 0 then
Put icon of button "New Button" into DeleteIcon
KillResID StackName,"ICON",DeleteIcon
End if
Put GetDocIcon(ApplicationFile,DocumentFile,StackName) into AddIcon
UpdateResFork
Set icon of button "New Button" to AddIcon
Set style of button "New Button" to transparent
Set rect of button "New Button" to 220,150,315,198
Put "On MouseUp -- Document" & return into ScriptMaker
Put "Global LongName" & return after ScriptMaker
Put "Put " & quote & DocumentFile & "," & ApplicationFile & quote & " into LongName" & return after ScriptMaker
Put "LaunchDocument" & return after ScriptMaker
Put "End MouseUp" & return & return after ScriptMaker
Put "--" & return after ScriptMaker
Put "-- FOR 'PORTFOLIO' TO FUNCTION CORRECTLY; DO NOT MODIFY THIS SCRIPT!" & return after ScriptMaker
Put "--" & return after ScriptMaker
Set script of button "New Button" to ScriptMaker
Set name of button "New Button" to DocumentName
Choose browse tool
Set LockScreen to false
Show message window at 20,35
Put "Press COMMAND KEY down; CLICK and DRAG icon into position."
Exit AddDocument
End AddDocument
------------------------------------------------------------------------
-- ADD DESK ACCESSORY
------------------------------------------------------------------------
On AddDA
Set LockScreen to true
Show message window at 20,302
Put "NOTE: the DA must be installed in your system for this to work."
Ask "Type the exact name of the Desk Accessory?"
If it is not empty then
Put it into DaName
DoMenu New Button
Set cursor to 4
Set icon of button "New Button" to 18499
Set style of button "New Button" to transparent
Set rect of button "New Button" to 220,150,315,198
Put "On MouseUp -- DA" & return into ScriptMaker
Put "Global LongName" & return after ScriptMaker
Put "Put " & quote & it & quote & " into LongName" & return after ScriptMaker
Put "LaunchDA" & return after ScriptMaker
Put "End MouseUp" & return & return after ScriptMaker
Put "--" & return after ScriptMaker
Put "-- FOR 'PORTFOLIO' TO FUNCTION CORRECTLY; DO NOT MODIFY THIS SCRIPT!" & return after ScriptMaker
Put "--" & return after ScriptMaker
Set script of button "New Button" to ScriptMaker
Set name of button "New Button" to DaName
End if
Choose browse tool
Set LockScreen to false
Show message window at 20,35
Put "Press COMMAND KEY down; CLICK and DRAG icon into position."
Exit AddDA
End AddDA
------------------------------------------------------------------------
-- DELETE ANY FILE
------------------------------------------------------------------------
On TrashAny
Show message window at 20,302
Put "Please select the file that you wish to 'DELETE'."
Put FileName() into LongName
If LongName is empty then
Put ""
Set LockScreen to false
Hide message window
Exit TrashAny
End if
Set cursor to 4
Put LastPathComponent(LongName) into NewName
Put "Delete File - "
Put NewName into word 7 of message window
Beep
Answer "Are you sure you want to delete this file?" with "Yes" or "No"
If it is "No" then
Put""
Set LockScreen to false
Hide message window
Exit TrashAny
End if
Put DeleteFile(LongName) into trash
If trash = 0 then
Put "The file has been deleted from your disk."
Wait 3 seconds
Put""
Set LockScreen to false
Hide message window
Exit TrashAny
End if
If trash < 0 then
Beep 2
OSERR trash
Else
Beep 2
Answer "Sorry, there was an un-define error!"
Exit trashAny
End if
Exit TrashAny
End TrashAny
------------------------------------------------------------------------
-- RENAME ANY FILE
------------------------------------------------------------------------
On RenameAny
Show message window at 20,302
Put "Please select the file that you wish to 'RENAME'."
Put FileName() into LongName
If LongName is empty then
Put""
Set LockScreen to false
Hide message window
Exit RenameAny
End if
Hide message window
Put LastPathComponent(LongName) into NewName
Beep
Ask "Rename this file to:" with NewName
If it is NewName or it is empty then
Put""
Set LockScreen to false
Hide message window
Exit RenameAny
End if
Put the length of it into container
If container > 25 then
Beep 2
Answer "Sorry, name is too long!"
Put""
Set LockScreen to false
Hide message window
Exit RenameAny
End if
Set cursor to 4
Put RenameFile(LongName,it) into NewFile
If NewFile = 0 then
Put "The file on your disk has been renamed."
Wait 3 seconds
Put ""
Set LockScreen to false
Hide message window
Exit RenameAny
Else
If NewFile < 0 then
Beep 2
OSERR NewFile
Else
Beep 2
Answer "Sorry, there was an un-define error!"
Exit RenameAny
End if
End if
End RenameAny
------------------------------------------------------------------------
-- SHUT DOWN COMPUTER
------------------------------------------------------------------------
On ShutOff
Beep
Answer "Are you ready to 'SHUTDOWN' the computer:" with "Yes" or "No"
If it is "No" then
Set LockScreen to false
Exit ShutOff
End if
Put the freesize of this stack into it
If it > 10000 then
Beep
Show message window at 20,302
Put "Wasted Space - "
Put it into word 5 of message window
Put " bytes in 'Portfolio'." into word 7 of message window
Answer "Before Shut Down; should I compact this stack?" with "No" or "Yes"
If it = "Yes" then
Set cursor to 4
Hide message window
DoMenu Compact Stack
end if
end if
ShutDown
End ShutOff
------------------------------------------------------------------------
-- SCAN ALL CARDS
------------------------------------------------------------------------
On ScanCards
Beep
Answer "Please choose a display speed:" with "Slow" or "Fast" or "Cancel"
If it is "Cancel" then
Set LockScreen to False
Exit ScanCards
End if
Set cursor to 4
Show message window at 20,302
Put "To stop browsing, just click the 'MOUSE BUTTON'."
Wait 3 seconds
Put ""
Hide message window
If it is "Fast" then
Wait 2 seconds
Show all cards
Else
Repeat for number of cards
Wait 3 seconds
If the MouseClick then
Exit repeat
End if
Visual effect barn door open
Go to next card
End repeat
End if
End ScanCards
------------------------------------------------------------------------
-- Launch Application
------------------------------------------------------------------------
On LaunchApplication
Global Action
If Action = "Abort" then
Put "Launch" into action
Exit LaunchApplication
End if
Set cursor to 4
Global LongName
If MultiFinder() is true then
If IsRunning(short name of the target) is true then
Beep
Answer "Use MultiFinder; Application is running!"
Else
Put SubLaunch (LongName) into OutCome
If OutCome < 0 then OSERR OutCome
Else
If OutCome > 0 then beep
End if
End if
Else
Open LongName
End if
End LaunchApplication
------------------------------------------------------------------------
-- LAUNCH DOCUMENT
------------------------------------------------------------------------
On LaunchDocument
Global Action
If Action = "Abort" then
Put "Launch" into action
Exit LaunchDocument
End if
Set cursor to 4
Global LongName
Put ButtonName(LongName) into ApplicationName
Put second item of LongName into ApplicationPath
Put first item of LongName into DocumentPath
If MultiFinder() is true then
If IsRunning(ApplicationName) is true then
Beep
Answer "Use MultiFinder; document is open!"
Else
Put SubLaunch(ApplicationPath,DocumentPath) into OutCome
If OutCome < 0 then OSERR OutCome
Else if OutCome > 0 then beep
End if
Else
Open DocumentPath with ApplicationPath
End if
End LaunchDocument
------------------------------------------------------------------------
-- LAUNCH STACK
------------------------------------------------------------------------
On LaunchStack
Global Action
If Action = "Abort" then
Put "Launch" into action
Exit LaunchStack
End if
Set cursor to 4
Global LongName
Push card
Visual effect zoom open
Go to LongName
End LaunchStack
------------------------------------------------------------------------
-- LAUNCH DA
------------------------------------------------------------------------
On LaunchDA
Global Action
If Action = "Abort" then
Put "Launch" into action
Exit LaunchDA
End if
Set cursor to 4
Global LongName
Push card
Visual effect zoom open
DoMenu LongName
End LaunchDA
------------------------------------------------------------------------
-- DIRECT LAUNCH APPLICATION
------------------------------------------------------------------------
On DirectLaunch
Set LockScreen to true
Show message window at 20,302
Put "You may now 'LAUNCH' into and return from any application."
Global LongName
Put FileName("APPL") into LongName
If LongName is not empty then
Set cursor to 4
LaunchApplication
End if
Put ""
Set LockScreen to false
Hide message window
End DirectLaunch
------------------------------------------------------------------------
-- REMOVE BUTTON FROM CARD
------------------------------------------------------------------------
On RemoveButton
Global ShortName
Beep
Answer "Remove that button from this card?" with "Yes" or "NO"
If it = "No" then
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit RemoveButton
End If
Set cursor to 4
Get the long name of this stack
Put it into StackName
Put icon of button ShortName into DeleteIcon
KillResID StackName,"ICON",DeleteIcon
DoMenu Cut Button
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit RemoveButton
End RemoveButton
------------------------------------------------------------------------
-- DELETE BUTTON / FILE ON CARD AND DISK
------------------------------------------------------------------------
On DeleteFileButton
Global ShortName
Beep
Answer "Delete button / file from card / disk?" with "Yes" or "NO"
If it = "No" then
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End if
Set cursor to 4
Get script of button ShortName
Put it into container
If container is empty then
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End if
Get line 1 of container
Put it into Type
Get word 4 of Type
Put it into ScriptType
If ScriptType ="DA" then
RemoveDA
Exit DeleteFileButton
End If
If ScriptType ="Document" then
Beep 2
Answer "Document deleting not yet available." with "OK"
Choose browse tool
Put""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End if
Get line 3 of container
Put it into NewContainer
Get word 2 of NewContainer
Put it into Container
Delete first char of container
Delete last char of container
Put container into LongName
If LongName is empty then
Put ""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End if
Put DeleteFile(LongName) into trash
If trash = 0 then
Get the long name of this stack
Put it into StackName
Put icon of button ShortName into DeleteIcon
KillResID StackName,"ICON",DeleteIcon
DoMenu Cut Button
Choose browse tool
Put "The button / file on your card / disk has been deleted."
Wait 3 Seconds
Put ""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End if
If trash < 0 then
Beep 2
OSERR trash
Else
Beep 2
Answer "Sorry, there was an un-define error!"
End if
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit DeleteFileButton
End DeleteFileButton
----- REMOVE DA'S
On RemoveDA
DoMenu Cut Button
Choose browse tool
Put "The DA button has been deleted from your card."
Wait 3 Seconds
Put ""
Set LockScreen to false
Hide message window
Exit RemoveDA
End RemoveDA
------------------------------------------------------------------------
-- RENAME BUTTON / FILE ON CARD AND DISK
------------------------------------------------------------------------
On RenameFileButton
Global ShortName, NewName, ScriptType
Beep
Ask "Rename this file to:" with ShortName
If it is ShortName or it is empty then
Choose browse tool
Put""
Set LockScreen to false
Hide message window
Exit RenameFileButton
End if
Put it into NewName
Put the length of it into container
If container > 25 then
Beep 2
Answer "Sorry, name is too long!"
Put""
Set LockScreen to false
Hide message window
Exit RenameFileButton
End if
Set cursor to 4
Get script of button ShortName
Put it into container
If container is empty then
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit RenameFileButton
End if
Get line 1 of container
Put it into Type
Get word 4 of Type
Put it into ScriptType
If ScriptType ="DA" then
RenameDA
Exit RenameFileButton
End if
If ScriptType ="Document" then
Beep 2
Answer "Document renaming not yet available." with "OK"
Choose browse tool
Put""
Set LockScreen to false
Hide message window
Exit RenameFileButton
End if
If ScriptType ="Application" then
RenameTheFile
Exit RenameFileButton
End if
If ScriptType ="Stack" then
RenameTheFile
Exit RenameFileButton
End if
End RenameFileButton
----- RENAME APPLICATIONS & STACKS
On RenameTheFile
Global ShortName, NewName, ScriptType
If scriptType = "Application" then put "LaunchApplication" into ThisWay
If scriptType = "Stack" then put "LaunchStack" into ThisWay
Get script of button ShortName
Put it into container
Get line 3 of container
Put it into NewContainer
Get word 2 of NewContainer
Put it into Container
Delete first char of container
Delete last char of container
Put container into LongName
If LongName is empty then
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit RenameTheFile
End if
Put RenameFile(LongName,NewName) into NewFile
If NewFile = 0 then
Put DeleteLastPart(LongName)&NewName into NewPathName
Put "On MouseUp -- " & ScriptType & return into ScriptMaker
Put "Global LongName" & return after ScriptMaker
Put "Put " & quote & NewPathName & quote & " into LongName" & return after ScriptMaker
Put ThisWay & return after ScriptMaker
Put "End MouseUp" & return & return after ScriptMaker
Put "--" & return after ScriptMaker
Put "-- FOR 'PORTFOLIO' TO FUNCTION CORRECTLY; DO NOT MODIFY THIS SCRIPT!" & return after ScriptMaker
Put "--" & return after ScriptMaker
Set script of button ShortName to ScriptMaker
Set name of button ShortName to NewName
Put "The file on your disk and card has been renamed."
Wait 3 seconds
Choose browse tool
Put ""
Set LockScreen to false
Hide message window
Exit RenameTheFile
Else
If NewFile < 0 then
Beep 2
OSERR NewFile
Else
Beep 2
Answer "Sorry, there was an un-define error!"
Exit RenameTheFile
End if
End if
End RenameTheFile
----- RENAME DA'S
On RenameDA
Global NewName, ShortName
Put "On MouseUp -- DA" & return into ScriptMaker
Put "DoMenu " & quote & NewName & quote & return after ScriptMaker
Put "End MouseUp" & return after ScriptMaker
Set script of button ShortName to ScriptMaker
Set name of button ShortName to NewName
Put " Have renamed DA on card only. Can not rename installed system DA."
Wait 3 Seconds
Choose browse tool
Put""
Set LockScreen to false
Hide message window
End RenameDA